package xcmg.device.infra.enums;

import org.apache.commons.lang.StringUtils;

/**
 * 付款方式
 */
public enum PayTypeEnum {

  CASH(1, "现金"),
  SPREAD(2, "差价"),
  ACCEPTANCE(3, "承兑"),
  FINANCING(4, "融资"),
  RECONCILIATION(5, "调账"),
  CASH_BACK(6, "返利"),
  SERVICE_FEE(7, "服务费"),
  REPORT_DEDUCTION(8, "报告抵扣"),
  EASY_LOAN(9, "易贷"),
  THREE_PARTY_TRANSFER(10, "三方转账"),
  WIRE_TRANSFER(11, "电汇"),
  OTHER(12, "其它");

  private Integer payType;

  private String payDesc;

  public static String getDescByType(Integer type) {
    if (null == type) {
      return StringUtils.EMPTY;
    }
    for (PayTypeEnum payType : PayTypeEnum.values()) {
      if (payType.getPayType().equals(type)) {
        return payType.getPayDesc();
      }
    }
    return StringUtils.EMPTY;
  }


  PayTypeEnum(Integer payType, String payDesc) {
    this.payType = payType;
    this.payDesc = payDesc;
  }

  public Integer getPayType() {
    return payType;
  }

  public void setPayType(Integer payType) {
    this.payType = payType;
  }

  public String getPayDesc() {
    return payDesc;
  }

  public void setPayDesc(String payDesc) {
    this.payDesc = payDesc;
  }
}
